{include file="public/head"}

<body>
	<div class="x-body">
		<form class="lotus-nav">

			<button type="button" class="layui-btn  layui-btn-sm" onclick="x_admin_show('添加管理员','addHistory.html',900,600)">
               添加
            </button>

			<div class="layui-input-inline">
				<input id="" name="keyword" class="layui-input lotus-input" placeholder="请输入关键词搜索" value="{$Think.get.keyword}">
			</div>

			<button class="layui-btn layui-btn-sm"><i class="layui-icon layui-icon-search"></i></button>
			<button type="button" class="layui-btn layui-btn-sm" onclick="location='/admin/Admin/index'">重置</button>

			<span class="x-right">共有数据:<i class="i_count">{$list->total()}</i>条 <button onclick="javascript:location.reload()" class="layui-btn-default "><i class="layui-icon layui-icon-refresh"></i></button></span>

		</form>

		<table class="layui-table">
			<thead>
				<tr>
					<th>ID</th>
					<th>期号</th>
					<th>1</th>
					<th>2</th>
					<th>3</th>
					<th>4</th>
					<th>5</th>
					<th>1</th>
					<th>2</th>
					<th>时间</th>
					<th>操作</th>
			</thead>
			<tbody>
				{volist name="list" id="vo"}
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.period}</td>
					<td>{$vo.red1}</td>
					<td>{$vo.red2}</td>
					<td>{$vo.red3}</td>
					<td>{$vo.red4}</td>
					<td>{$vo.red5}</td>
					<td>{$vo.blue1}</td>
					<td>{$vo.blue2}</td>
					<td>{$vo.create_time}</td>
					<td>
						<button class="layui-btn layui-btn-xs" onclick="x_admin_show('编辑管理员','editHistory.html?id={$vo.id}',900,600)">编辑</button>
					</td>
				</tr>
				{/volist}
			</tbody>
		</table>
		<div class="page">
			<div>
				{$list|raw}
			</div>
		</div>
	</div>
</body>
{include file="public/foot"}
<script>
	function delUser(obj, id) {
		var count = $(".i_count")[0].innerText;
		layer.confirm('确认要删除吗？', function(index) {
			//捉到所有被选中的，发异步进行删除
			$.post("{:url('admin/admin/deleteAdmin')}", {
				id: id
			}, function(data, textStatus, xhr) {
				/*optional stuff to do after success */
				console.log(data);
				if(data.code == 1) {
					layer.msg(data.msg, {
						icon: 1,
						time: 1000
					}, function() {
						$(obj).parents('tr').remove();
						$(".i_count").html(count - 1);
					});
				} else {
					layer.msg(data.msg, {
						icon: 2,
						time: 1000
					});
				}

			});
		});
	}
</script>